home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / PCICommonPlugin.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  3KB  |  129 lines

  1. /*
  2.      File:        PCICommonPlugin.h
  3.  
  4.      Contains:    This file contains all interface related structures and prototypes common for pci expert to
  5.  
  6.      Version:    Technology:    Copland
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __PCICOMMONPLUGIN__
  19. #define __PCICOMMONPLUGIN__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __NAMEREGISTRY__
  25. #include <NameRegistry.h>
  26. #endif
  27. #ifndef __ERRORS__
  28. #include <Errors.h>
  29. #endif
  30. #ifndef __DRIVERFAMILYMATCHING__
  31. #include <DriverFamilyMatching.h>
  32. #endif
  33. #ifndef __INTERRUPTS__
  34. #include <Interrupts.h>
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT_SUPPORTED
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_ALIGN_SUPPORTED
  46. #pragma options align=mac68k
  47. #endif
  48.  
  49. #if FOR_SYSTEM8_PREEMPTIVE
  50. /* typedefs for common plugins interface*/
  51. typedef void (*DefaultEnablerFuncPtr)(InterruptSetMember setIDMember, void *refCon);
  52. typedef InterruptSourceState (*DefaultDisablerFuncPtr)(InterruptSetMember setIDMember, void *refCon);
  53. typedef InterruptMemberNumber (*DefaultDispatcherFuncPtr)(InterruptSetMember setIDMember, void *info, UInt32 theIntCount);
  54. typedef OSStatus (*InitializeFuncPtr)(void);
  55. typedef OSStatus (*FinalizeFuncPtr)(void);
  56. struct PCIPluginHeader {
  57.     UInt32                             version;
  58.     UInt32                             reserved1;
  59.     UInt32                             reserved2;
  60.     UInt32                             reserved3;
  61.     PluginLoadID                     thisPluginLoadID;
  62. };
  63. typedef struct PCIPluginHeader PCIPluginHeader;
  64.  
  65. typedef PCIPluginHeader *PCIPluginHeaderPtr;
  66. /* pci bridge descriptor definition*/
  67. struct PCIBridgeDescriptor {
  68.     PCIPluginHeader                 InterfaceHeader;
  69.     DriverDescription *                TheDomainDriverDescription;
  70.     DefaultEnablerFuncPtr             DefaultBridgeEnablerFunc;
  71.     DefaultDisablerFuncPtr             DefaultBridgeDisablerFunc;
  72.     DefaultDispatcherFuncPtr         DefaultBridgeDispatcherFunc;
  73.     FinalizeFuncPtr                 FinalizeFunc;
  74. };
  75. typedef struct PCIBridgeDescriptor PCIBridgeDescriptor;
  76.  
  77. typedef PCIBridgeDescriptor *PCIBridgeDescriptorPtr;
  78. /*
  79.  pci bridge variables for bridges
  80.     stolen from marconi InterruptsAssign.c written by Matt Nelson
  81. */
  82. struct DefaultBridgeVariables {
  83.     UInt32                             lastEntryIntCount;
  84.     InterruptMemberNumber             lastServicedMember;
  85.     UInt32                             totalMembersScanned;
  86.     UInt32                             totalMemberCount;
  87.     UInt8 *                            memberEnableFlags;
  88. };
  89. typedef struct DefaultBridgeVariables DefaultBridgeVariables;
  90.  
  91. typedef DefaultBridgeVariables *DefaultBridgeVariablesPtr;
  92. /* pci header interface version definition*/
  93.  
  94. enum {
  95.     kPCIPluginVersion1000        = 0x01000000                    /* initial pci family interface release*/
  96. };
  97.  
  98. /* pci error codes*/
  99.  
  100. enum {
  101.     kPCIerrorNoError            = noErr,
  102.     kPCIerrorNoDeviceFound        = nrInvalidNodeErr,
  103.     kPCIerrorNoDomainFound        = resNotFound,
  104.     kPCIerrorBadPointerFound    = smBadsPtrErr,
  105.     kPCIerrorBadValueFound        = kernelReturnValueErr,
  106.     kPCIerrorBadRegPropertyFound = nrNotFoundErr,
  107.     kPCIerrorNoNotificationProduced = resNotFound,
  108.     kPCIerrorMemoryAllocationFailed = nrNotEnoughMemoryErr,
  109.     kPCIerrorUnsupportedPluginVersion = kernelUnsupportedErr,
  110.     kPCIerrorFatal                = kernelUnrecoverableErr
  111. };
  112.  
  113. #endif
  114.  
  115. #if PRAGMA_ALIGN_SUPPORTED
  116. #pragma options align=reset
  117. #endif
  118.  
  119. #if PRAGMA_IMPORT_SUPPORTED
  120. #pragma import off
  121. #endif
  122.  
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126.  
  127. #endif /* __PCICOMMONPLUGIN__ */
  128.  
  129.